/*
* uses vmmcall to modify vm  reg,then dump it
*/

#include<stdio.h>
#include<string.h>
#include <unistd.h>

int main()
{
    long ret = 100;
    long val = 0;

    while(1) {
        asm volatile("mov %0,%%rbx" : "=m"(ret));
        asm volatile("vmmcall" :: "a"(100));
        asm volatile("mov %%rbx,%0" : "=m"(val));
        printf("rbx = %ld\n",val);
        sleep(1);
    }
}

